/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package dk.itu.samd.group2.tagapastry;

import java.util.Vector;
import dk.itu.samd.group2.tagapastry.messages.IndexMsg;
import dk.itu.samd.group2.tagapastry.messages.TagapastryMsg;

/**
 *
 * @author frgr
 */
public interface IndexRelative {
		
	public Vector<TagapastryMsg> getMsgBuffer();
	
	public Tag getTag();

	public void expand(TagapastryImpl tagaImpl, Vector<IndexEntry> entries);
	
	public void retract(TagapastryImpl tagaImpl);
	
	public static enum State {
		INACTIVE,
		AWAITING_EXPANSION_CONFIRMATION,
		ACTIVE,
		AWAITING_RETERACTION_CONFIRMATION
	}
	
	/*
	 * Relative depending on its own state knows how to handle msg
	 */
	public void bufferOrForward(IndexMsg msg, TagapastryImpl tagaImpl);
	
	public void activate(TagapastryImpl tagaImpl);
	
	public void deactivate();

	public boolean isInactive();
	
	public int getSize();
}
